package com.morningstar.flow.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.morningstar.common.dao.entity.BaseEntity;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * 流程信息
 */
@Setter
@Getter
@TableName(value = "flow_process", autoResultMap = true)
public class FlowProcess extends BaseEntity {

    @TableId(value = "process_id", type = IdType.ASSIGN_ID)
    private Long processId;

    @TableField("process_name")
    private String processName;

    @TableField("process_key")
    private String processKey;

    @TableField("process_version")
    private String processVersion;

    @TableField("process_group_id")
    private Long processGroupId;

    @TableField(value = "process_data", typeHandler = JacksonTypeHandler.class)
    private Object processData;

    @TableField("process_admin")
    private Long processAdmin;

    @TableField("form_id")
    private Long formId;

    @TableField("deploy")
    private String deploy;

    @TableField("deployment_id")
    private String deploymentId;
    /**
     * 0 未部署
     * 1 已部署
     * 2 测试
     * 3 线上
     */
    @TableField("status")
    private String status;

    @TableField(exist = false)
    private String processGroupName;

    @TableField(exist = false)
    private String formName;

    @TableField(exist = false)
    private String bpmnXml;

    /**
     * 流程节点
     */
    @TableField(exist = false)
    private List<FlowNode> nodeList;
}
